package com.coder4j.entity;

import com.coder4j.starter.mybatis.BaseEntity;
import com.coder4j.starter.mybatis.annotation.TableAttribute;
import java.util.Date;
import lombok.Data;

/**
 * 任务流程详情
 * @author keller
 * @date 2025-03-18 16:22:26
 */
@Data
@TableAttribute("s_task_flow_detail")
public class STaskFlowDetailEntity extends BaseEntity{

    /**
     * 关联任务ID
     */
    private Integer taskFlowId;

    /**
     * 步骤名称
     */
    private String nodeName;

    /**
     * 开始时间
     */
    private String startTime;

    /**
     * 结束时间
     */
    private String endTime;

    /**
     * 视觉
     */
    private String vision;

    /**
     * 听觉
     */
    private String hearing;

    /**
     * 认知
     */
    private String cognition;

    /**
     * 精细运动
     */
    private String fineMotorSkills;

    private String fId;

    public static STaskFlowDetailEntity getEnt(String nodeName,String fId){
        STaskFlowDetailEntity sTaskFlowDetailEntity = new STaskFlowDetailEntity();
        sTaskFlowDetailEntity.setNodeName(nodeName);
        sTaskFlowDetailEntity.setFId(fId);
        return sTaskFlowDetailEntity;
    }


    public int getStartTimeAsInt() {
        try {
            return Integer.parseInt(startTime);
        } catch (NumberFormatException e) {
            // 处理解析异常，可以返回一个默认值或者抛出异常
            return 0;
        }
    }

    public int getEndTimeAsInt() {
        try {
            return Integer.parseInt(endTime);
        } catch (NumberFormatException e) {
            // 处理解析异常，可以返回一个默认值或者抛出异常
            return 0;
        }
    }
}
